mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-26 04:58:06 +11:00
Compare commits
3 Commits
e259e3d02e
...
8926c33ab1
Author | SHA1 | Date | |
---|---|---|---|
|
8926c33ab1 | ||
|
4180b5873d | ||
|
6281e2036f |
@ -27,34 +27,29 @@ addDE:
|
|||||||
noop: ; piggy backing on the first "ret" we have
|
noop: ; piggy backing on the first "ret" we have
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; copy (DE) into DE, little endian style (addresses in z80 are always have
|
; copy (HL) into DE, then exchange the two, utilising the optimised HL instructions.
|
||||||
; their LSB before their MSB)
|
; ld must be done little endian, so least significant byte first.
|
||||||
intoDE:
|
|
||||||
push af
|
|
||||||
ld a, (de)
|
|
||||||
inc de
|
|
||||||
ex af, af'
|
|
||||||
ld a, (de)
|
|
||||||
ld d, a
|
|
||||||
ex af, af'
|
|
||||||
ld e, a
|
|
||||||
pop af
|
|
||||||
ret
|
|
||||||
|
|
||||||
intoHL:
|
intoHL:
|
||||||
push de
|
push de
|
||||||
ex de, hl
|
ld e, (hl)
|
||||||
call intoDE
|
inc hl
|
||||||
|
ld d, (hl)
|
||||||
ex de, hl
|
ex de, hl
|
||||||
pop de
|
pop de
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
intoDE:
|
||||||
|
ex de, hl
|
||||||
|
call intoHL
|
||||||
|
ex de, hl ; de preserved by intoHL, so no push/pop needed
|
||||||
|
ret
|
||||||
|
|
||||||
intoIX:
|
intoIX:
|
||||||
push de
|
push ix
|
||||||
push ix \ pop de
|
ex (sp), hl ;swap hl with ix, on the stack
|
||||||
call intoDE
|
call intoHL
|
||||||
push de \ pop ix
|
ex (sp), hl ;restore hl from stack
|
||||||
pop de
|
pop ix
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; add the value of A into HL
|
; add the value of A into HL
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# readlink -f doesn't work with macOS's implementation
|
||||||
|
# so, if we can't get readlink -f to work, try python with a realpath implementation
|
||||||
|
ABS_PATH=$(readlink -f "$0" || python -c "import sys, os; print(os.path.realpath('$0'))")
|
||||||
|
|
||||||
# wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
|
# wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
|
||||||
DIR=$(dirname $(readlink -f "$0"))
|
DIR=$(dirname "${ABS_PATH}")
|
||||||
ZASMBIN="${DIR}/emul/zasm/zasm"
|
ZASMBIN="${DIR}/emul/zasm/zasm"
|
||||||
CFSPACK="${DIR}/cfspack/cfspack"
|
CFSPACK="${DIR}/cfspack/cfspack"
|
||||||
INCCFS=$(mktemp)
|
INCCFS=$(mktemp)
|
||||||
|
Loading…
Reference in New Issue
Block a user