Ninth example
-a100
297D:0100 MOV AH,02 ; Function 2 (writes on the screen)
297D:0102 MOV DL,BL ; Puts BL value on DL
297D:0104 MOV CL,04 ; Puts 04 value on CL
297D:0106 SHR DL,CL ; Moves per four bits of your number to the
;rightmost nibble
297D:0108 ADD DL,30 ; Adds 30 to DL
297D:010B CMP DL,3A ; Compares Dl with 3A
297D:010E JL 0113 ; Jumps if < 0113 direction
297D:0110 ADD DL,07 ; Adds 07 to DL
297D:0113 INT 21 ; Calls for Dos
297D:0115 MOV DL,BL ; Puts Bl value on DL
297D:0117 AND DL,0F ; Carries ANDing numbers bit by bit
297D:011A ADD DL,30 ; Adds 30 to DL
297D:011D CMP DL,3A ; Compares Dl with 3A
297D:0120 JL 0125 ; Jumps if < 125 direction
297D:0122 ADD DL,07 ; Adds 07 to DL
297D:0125 INT 21 ; Calls for Dos
297D:0127 INT 20 ; Ends the Program
This program works for printing the second of two digit hex numbers
Tenth example
-a100
297D:0100 MOV AH,01 ; Function 1 (reads keyboard)
297D:0102 INT 21 ; Calls for Dos
297D:0104 MOV DL,AL ; Puts Al value on DL
297D:0106 SUB DL,30 ; Subtracts 30 from DL
297D:0109 CMP DL,09 ; Compares DL with 09
297D:010C JLE 0111 ; Jumps if <= 0111 direction
297D:010E SUB DL,07 ; Subtracts 07 from DL
297D:0111 MOV CL,04 ; Puts 04 value on CL register
297D:0113 SHL DL,CL ; It inserts zeros to the right
297D:0115 INT 21 ; Calls for Dos
297D:0117 SUB AL,30 ; Subtracts 30 from AL
297D:0119 CMP AL,09 ; Compares AL with 09
297D:011B JLE 011F ; Jumps if <= 011f direction
297D:011D SUB AL,07 ; Subtracts 07 from AL
297D:011F ADD DL,AL ; Adds Al to DL
297D:0121 INT 20 ; Ends the Program
This program can read two digit hex numbers
Eleventh example
-a100
297D:0100 CALL 0200 ; Calls for a procedure
297D:0103 INT 20 ;Ends the program
-a200
297D:0200 PUSH DX ; Puts DX value on the stack
297D:0201 MOV AH,08 ; Function 8
297D:0203 INT 21 ; Calls for Dos
297D:0205 CMP AL,30 ; Compares AL with 30
297D:0207 JB 0203 ; Jumps if CF is activated towards 0203 direction
297D:0209 CMP AL,46 ; Compares AL with 46
297D:020B JA 0203 ; jumps if <> 0203 direction
297D:020D CMP AL,39 ; Compares AL with 39
297D:020F JA 021B ; Jumps if <> 021B direction
297D:0211 MOV AH,02 ; Function 2 (writes on the screen)
297D:0213 MOV DL,AL ; Puts Al value on DL
297D:0215 INT 21 ; Calls for Dos
297D:0217 SUB AL,30 ; Subtracts 30 from AL
297D:0219 POP DX ; Takes DX value out of the stack
297D:021A RET ; Returns control to the main program
297D:021B CMP AL,41 ; Compares AL with 41
297D:021D JB 0203 ; Jumps if CF is activated towards 0203 direction
297D:021F MOV AH,02 ; Function 2 (writes on the screen)
297D:022 MOV DL,AL ; Puts AL value on DL
297D:0223 INT 21 ; Calls for Dos
297D:0225 SUB AL,37 ; Subtracts 37 from AL
297D:0227 POP DX ; Takes DX value out of the stack
297D:0228 RET ; Returns control to the main program
This program keeps reading characters until it receives one that can be
converted to a hex number
Quantum Computing: Revolutionizing the Future with Cutting-Edge
Advancements Introduction to Quantum Computing
-
Quantum Computing: Revolutionizing the Future with Cutting-Edge
Advancements
Introduction to Quantum Computing
Quantum computing is tran...
No comments:
Post a Comment