[A83] Re: ashell and SOS to ion converter?


[Prev][Next][Index][Thread]

[A83] Re: ashell and SOS to ion converter?




> what do the commands like IN and OUT do in direct input?
In and out are the commands that allow the processor to 
communicate with other pieces of hardware through ports 
(not necessarily in the case of direct input). When you're 
using direct input, you first send out the appropriate 
value to activate certain areas (connected to the 
individual bits of the byte sent) of the keyboard for 
reading, then you do the actual reading (again, the bits 
are connected to individual key in the area).

> Is it possible to have a 32 bit variable in assembly?
It is, but you naturally cannot store 32 bit values in 
single registers. You must use the memory to store these 
vars, and you have to temporarily load them into regs to 
calculate with them. E. g. to add the value of the 32-bit 
number at HL to that found at IX you can do (both numbers 
start with the LSB):

ld b,(hl)        ; here we load the number into
inc hl           ; EDCB (E is the MSB, B is the LSB)
ld c,(hl)
inc hl
ld d,(hl)
inc hl
ld e,(hl)
ld a,b           ; from here we do the addition and
add a,(ix)       ; the writeback
ld (ix),a
ld a,c
adc a,(ix+1)
ld (ix+1),a
ld a,d
adc a,(ix+2)
ld (ix+2),a
ld a,e
adc a,(ix+3)
ld (ix+3),a

Of course this code is highly unoptimised, but it probably 
gives a general idea of what you can do.

PG



References: