feat(buzbee): add command hashing mode
This commit is contained in:
@@ -12,15 +12,9 @@ BUZBEE IMPORT
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
BBIN_BASE EQU $0200
|
||||
BBIN_DEPTH EQU $7F
|
||||
BBIN_BASE EQU $0200
|
||||
BBIN_DEPTH EQU $7F
|
||||
BBTOKENS_BASE EQU $0280
|
||||
BBTOKENS_DEPTH EQU $3F
|
||||
BBTOKENS_CCH EQU $02C0
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; BUZBEE Structures
|
||||
;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
BBVARS STRUCT
|
||||
INPUT rmb BBIN_DEPTH
|
||||
ENDSTRUCT
|
||||
|
15
src/buzbee.s
15
src/buzbee.s
@@ -95,6 +95,21 @@ FULLBUF@
|
||||
jsr POUTCHAR
|
||||
bra INPLOOP
|
||||
|
||||
; Makes a hash of four chars in BBIN starting at offset X.
|
||||
; @param X: offset in BBIN to read the four chars from
|
||||
; @return A: resulting hash
|
||||
MKCMDSUM
|
||||
pshs b
|
||||
ldb #4 ; Loop over four chars
|
||||
clra ; Initialize accumulator
|
||||
NEXTC@
|
||||
suba BBIN_BASE,x ; Subtract current char from accumulator
|
||||
leax 1,x ; Next char
|
||||
decb ; Reduce count
|
||||
cmpb #0 ; Are we at the end?
|
||||
bne NEXTC@ ; No? loop
|
||||
rts
|
||||
|
||||
PROMPTLINE
|
||||
fcb $0D,$0A,$25,$00 ; CR LF '%' NUL
|
||||
|
||||
|
Reference in New Issue
Block a user