ack/mach/i80/libem/ngi4.s
1987-01-28 18:57:04 +00:00

32 lines
339 B
ArmAsm

.define .ngi4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! Exchange 32 bits integer by its two's complement
! Expects operand on stack
! Yields result on stack
.ngi4: pop d
lxi h,0
dad sp
xra a
sub m
mov m,a
inx h
mvi a,0
sbb m
mov m,a
inx h
mvi a,0
sbb m
mov m,a
inx h
mvi a,0
sbb m
mov m,a
push d
ret