Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
28
Task/Twos-complement/8080-Assembly/twos-complement.8080
Normal file
28
Task/Twos-complement/8080-Assembly/twos-complement.8080
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
org 100h ; program load point under CP/M
|
||||
;
|
||||
; the assembler itself will negate an
|
||||
; 8 or 16-bit constant for us
|
||||
;
|
||||
mvi a,-43 ; a = D5
|
||||
lxi h,-43 ; hl = FFD5
|
||||
;
|
||||
; no built-in opcode to negate an 8-bit
|
||||
; register, but nevertheless easily done
|
||||
;
|
||||
mvi a,43 ; a = 2B
|
||||
cma
|
||||
inr a ; a = D5
|
||||
;
|
||||
; the same approach for 16-bit values
|
||||
;
|
||||
lxi h,43 ; hl = 002B
|
||||
mov a,l
|
||||
cma
|
||||
mov l,a
|
||||
mov a,h
|
||||
cma
|
||||
mov h,a
|
||||
inx h ; hl = FFD5
|
||||
;
|
||||
jmp 0 ; exit to CP/M
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue