mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-01-10 02:29:23 +00:00
Immediate, or register, on LHS of copy
command.
This commit is contained in:
parent
26448ccce5
commit
13d38dc45f
@ -137,19 +137,14 @@ routine check_fire {
|
||||
}
|
||||
|
||||
routine init_game {
|
||||
// this shouldn't be needed!
|
||||
reserve byte temp_a
|
||||
ldy #0
|
||||
repeat bne {
|
||||
lda #$04
|
||||
sta temp_a
|
||||
copy temp_a >actor_pos, y
|
||||
copy #$04 >actor_pos, y
|
||||
tya
|
||||
clc
|
||||
asl .a
|
||||
asl .a
|
||||
sta temp_a
|
||||
copy temp_a <actor_pos, y
|
||||
copy .a <actor_pos, y
|
||||
iny
|
||||
cpy #8
|
||||
}
|
||||
|
@ -119,6 +119,24 @@ emitInstr p r (COPY (NamedLocation (Just Byte) src)
|
||||
"lda " ++ src ++ "\n" ++
|
||||
" sta " ++ dst ++ "_hi, " ++ (regName reg)
|
||||
|
||||
emitInstr p r (COPY (Immediate value)
|
||||
(LowByteOf (Indexed (NamedLocation (Just (Table Word _)) dst) reg))) =
|
||||
"lda #" ++ (show value) ++ "\n" ++
|
||||
" sta " ++ dst ++ "_lo, " ++ (regName reg)
|
||||
|
||||
emitInstr p r (COPY (Immediate value)
|
||||
(HighByteOf (Indexed (NamedLocation (Just (Table Word _)) dst) reg))) =
|
||||
"lda #" ++ (show value) ++ "\n" ++
|
||||
" sta " ++ dst ++ "_hi, " ++ (regName reg)
|
||||
|
||||
emitInstr p r (COPY A
|
||||
(LowByteOf (Indexed (NamedLocation (Just (Table Word _)) dst) reg))) =
|
||||
"sta " ++ dst ++ "_lo, " ++ (regName reg)
|
||||
|
||||
emitInstr p r (COPY A
|
||||
(HighByteOf (Indexed (NamedLocation (Just (Table Word _)) dst) reg))) =
|
||||
"sta " ++ dst ++ "_hi, " ++ (regName reg)
|
||||
|
||||
emitInstr p r (COPY (LowByteOf (Indexed (NamedLocation (Just (Table Word _)) src) reg))
|
||||
(NamedLocation (Just Byte) dst)) =
|
||||
"lda " ++ src ++ "_lo, " ++ (regName reg) ++ "\n" ++
|
||||
|
@ -577,9 +577,11 @@ copy_general_statement = do
|
||||
nspaces
|
||||
|
||||
src <- (immediate <|>
|
||||
register_location <|>
|
||||
low_byte_of_absolute <|> high_byte_of_absolute <|> direct_location)
|
||||
srcI <- many index
|
||||
lhs <- return $ case (src, srcI) of
|
||||
((Implicitly reg), []) -> reg
|
||||
((Immediately s), []) -> (Immediate s)
|
||||
((Directly s), []) -> (NamedLocation Nothing s)
|
||||
((Directly s), [reg]) -> (Indexed (NamedLocation Nothing s) reg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user