I have finally gotten an assembler working on my laptop so i have decided to venture out into the world of asm again. And I was going to go ahead and try to create sample programs from what i learn in 28 days, and also post some of the code used in that tutorial with comments on how i think it works. Then someone could possibly explain if i am on the right track or something similar.
Edit:Thanks to bfr and b-flat, my previous question has been solved so i will just go ahead and post how i think the code is working.
The Code:
Code:
Edit 2: Here is my attempt at 2d arrays. For some reason though it returns 9 instead of 10 like i thought it should.
Code:
Edit:Thanks to bfr and b-flat, my previous question has been solved so i will just go ahead and post how i think the code is working.
The Code:
Code:
.nolist
#include "ti83plus.inc" ; Standard header stuff
#define progstart $9d95
.list
.org progstart -2
.db $bb,$6d
ld a,3 ;sets a = 3
ld b,a ; now b = 3 also
add a,a ; a + a = 6
add a,b ; a + b = 9
ld d,0 ; de = 9
ld e,a
ld hl,array ; hl = memory address of array
add hl,de ;memory address + index(9) = i don't know
ld c,(hl) ; c is now equal to the value stored at hl's address
ld h,0 ; hl is now the equivalent of c
ld l,c
push hl ; hl is put on the stack
b_call(_clrlcdfull) ;screen is cleared
pop hl ; retrieve hl from the stack
b_call(_disphl) ; display the value of hl
ret ; end of code
array: ;array data
.db 0,1,2,3,4,5,6,7,8,9,10
.end
.end
Edit 2: Here is my attempt at 2d arrays. For some reason though it returns 9 instead of 10 like i thought it should.
Code:
.nolist
#include "ti83plus.inc"
#define progstart $9d95
.list
.org progstart - 2
.db $bb,$6d
b_call(_clrlcdfull)
ld b,2 ;b = 2
ld c,4 ;c = 4
ld hl,array ;hl = address of array
ld a,c ;a = 4
add a,a ;a = 8
add a,a ;a = 16
add a,b ;a = 18
ld d,0 ;de = 18
ld e,a
add hl,de ;address of hl + 18
ld a,(hl) ;a = value stored at address hl
inc hl ;hl = address + 1
ld h,(hl) ;hl = value stored at hl
ld l,a
b_call(_disphl) ; display hl
ret
array: ;array data
.dw 0,1,2,3,4,5,6
.dw 7,8,9,10,11,12
.dw 13,14,15,16,17,18
.dw 19,20,21,22,23,24
.dw 25,26,27,28,29,30
.end
.end