>Daniel's Homepage

Posts

My posts about programming and things.
Date format is day/month/year because I'm sane.

8085 assembly #0

4/1/2018

Recently I have been interested in assembly programming after coming across a new series of videos on the r/programming subreddit by Davy Wybiral (you can find the series here). In which, he focuses on x86 assembly using NASM. Using this and after personal research, in particular this x86 introduction series (namely the first day/part), my interest was peaked and I began playing around with simple 'hello world' programs. However I was finding it difficult to grasp the basic concepts, I had to try something different, a simpler architecture.

I was interested heavily in having an all in one compiler, editor, debugger, memory/register/stack viewer. The IDE also had to be completely open source and free software. I began looking for something that would meet these criteria. I quickly came across a simulator named GNUSim8085 (you can find the projects website here). This particular simulator and all-in-one IDE simulates the Intel 8085 micro processor, an 8-bit processor designed in 1977. After minor experimentation and researching the 8085 processor, I settled on learning and becoming comfortable with this IDE and eventually the instruction set. Meanwhile, I still have not completely grasped the assembly basics, however that will resolve itself over time.

Using the included example projects, heavily referring to an 8085 instruction set listing and other various resources found online, I began experimenting and slowly started understanding the basic concepts behind assembly languages.

Currently, I am able to produce very basic programs using some of the most basic instructions (mov, add, jmp, cmp etc), an example program I am able to write and understand is a simple countdown.

; COUNT DOWN FROM TOSTART -> TOEND

TOSTART: EQU 0AH	; HEX 10 TO START COUNTDOWN FROM
TOEND: EQU 00H		; HEX 0 TO COUNT DOWN TO

JMP START		; JUMP TO START

START:	MVI A,TOSTART	; MOVE TOSTART INTO ACCUMULATOR
	MVI B,TOEND	; MOVE TOEND INTO REGISTER B
LOOP:	CMP B		; COMPARE REGISTER TO ACCUMULATOR
	JZ END		; JUMP TO END IF ZERO FLAG SET
	DCR A		; DECREMENT A
	JMP LOOP	; JUMP BACK TO LOOP

END: HLT		; HALT EXECUTION
I hope to continue these posts as I further my understanding and abilities in 8085 assembly.



RSS feed
FSF member

page generated 1/12/2024 using websitegenerator in C