0 Members and 1 Guest are viewing this topic.
my_op:;;checks if x<y xor a sbc hl,de ld h,a rla ld l,a xor a ;sets type as uint16 ret
my_func00: .db "SPRITE",0 ;This is the name of the function;;To make sure Ans is preserved, use this default code ld hl,(ans_ptr) push hl push af ld a,(ans_type) push af;;Parse the arguments. Remember you can't modify DE or BC unless you save them.;;parseNum returns A as the type, HL as the value. It checks to make sure the input was a number, and since only uint16 is supported, you don't need to check the type. call parseNum \ ld a,l \ push af call parseNum \ pop af \ ld h,a \ push hl call parseData;;Now the stack holds the coordinates, HL points to the data string.;;Save BC,DE so we can have full reign ld (parsePtr),de ;Save these values ld (parseSize),bc ; pop bc ;B=X,C=Y call drawSprite;;Now restore BC,DE ld bc,(parseSize) ld de,(parsePtr);This is the default ending. Jump to closeFUnc with;A = ans_type;H = opening token. Ex. '(' for SPRITE(x,y,data);<stack> holds ans_ptr pop hl pop af jp closeFunc
Yes, it is almost OS independent using only four bcalls-- two to search for a var, 1 to to display a string,and 1 to convert an int to a string (I have routines for this, I just wanted a cheap way).Also, some tokens would need to be changed to pure ascii (space token, comma, decimal). I'm not exactly sure how to integrate such a program into KnightOS, but you are welcome to.In other news, I'm working on rebuilding FileSyst using this code and I'm making a bunch of headway.
Cool, I might try it some time when I actually have some free time.
So, are you doing a complete re-write of FileSyst, or are you working off of what you had before?