Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 03:38:27 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Hexadecimal Assembly Programming -  (Read 7193 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 17:58:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Topic starter
Total Post Ratings: +174

View Profile
« on: 22 January, 2011, 16:02:57 »
+4

I decided to create a topic for general discussion about general Hexadecimal Assembly programming. It is also a small tutorial and introduction.

What is hexadecimal?

Hexadecimal is a numeration system just like the Arabic one (1,2,3,4,5,6,7,8,9.5,11,12,...) or the Roman one (I,II,III,IV,V,X,L,MCM,...).
So, a number like seven can have multiple representations, according to the system used, let's check the number 28:


1
2
3
4
28          // Arabic
XXVIII    // Roman
1C        // Hexadecimal
11100  // Binary

So, why don't we all use the same? It's hard for all of us to use the same and some are useful in some situations but terrible in others. For example, to make a sprite we use binary or hexadecimal, but to solve a giant equation using any of those would be a pain in the ass!

Now, when we make a Calculator Assembly program (ld hl,1 ....), it is written as a binary file (10010101011110101010...). Binary is hard to read, so we just use Hexadecimal.

So, why don't we just program in Assembly and leave the Hexadecimal alone?

If we know how to code in Hexadecimal instead of using an assembler that makes our assembly code hexadecimal, we can program assembly on the calculator. Of course, with Mimas (and some others) we can also do it, and Mimas is quite good. However, I'm not sure if we can all use Mimas or if it has everything there is.

So, I assume you already know Assembly if you're reading this, and here's an Assembly program:


1
2
3
4
5
6
7
8
9
10
11
12
13
.nolist
#include "ti83plus.inc"
.list
    .org $9D95-2
    .db $BB, $6D

Start:
  B_CALL (_ClrLCDFull)
  ld hl,1
  B_CALL (_DispHL)
  B_CALL (_GetKey)
 
  ret

This program will Clear the Screen, the set the hl registers to 1, then display "1" and wait for a key press until ending.

The hexadecimal code it creates (the data) is something like:


1
2
3
4
5
EF4045  // ClrLCDFull
210100  // Set hl registers to 1
EF0745  // Display the hl registers, so display "1"
EF7249  // Wait for key press
C9

Now, how do I know this is the hexadecimal code for it? One, I checked the ti83plus.inc, I use Assemblex and I learnt it with Xeda. Now, the ti83plus.inc has all the hexadecimal codes for BCalls. Assemblex converts hexadecimal to assembly and disassembles files which lets me learn it from other programs.

Also, for opcodes such as 210100, I check this all the time!

How to program in my calculator?

Press PRGM
Create a new PRGM
Call it whatever you want
Then make it like this:


1
2
3
4
5
6
7
8
AsmPrgm
EF4045
EF7045 // Turns the run diagnostic off  B_CALL (_RunIndicOff)
FDCB00AE  // Disables the 'Done' message when the program closes (res 5,(iy+0))
210100
EF0745
EF7249
C9




Never forget the ending C9 (ret), without it the calculator crashes!

Now you can run that program by typing Asm(prgmNAME.

You can also compile it so you can run it in shells and it is a true Assembly program: AsmComp(prgmNAME,prgmNAME2)

Note, in AsmComp( the names have to be different. Also, press 2ND + 0 to access the catalog and use the Asm( and AsmPrgm and AsmComp( tokens, don't just type them.

I hope more discussion comes, for now, skim through the pages I gave you and try and make something new.

Note: The language on this tutorial may be wrong. For example, I said that AsmComp( made it a real Assembly program, but it was already, it just compiles it.

Also, concerning Assemblex, the last uploaded version is still not perfect, so you can have a demo here, but the 'Export to 8xp' isn't finished, so it does not count as an upload. Assemblex is what I use to program in Hexadecimal in my computer.

Discuss!

EDIT: You can also use brandonw's website for more bcalls and information, I think. The Z80 tables with opcodes can also be found in ticalc.org.


EDIT 2:
I have a lot to tell you yet, but for now, here's another program:


1
2
3
4
5
6
7
8
9
EF4045
3E01
C60A
2600
6F
EF0745
EF7249
EF4045
C9

Who guesses what this does?

* Assemblex0011.zip (13.77 KB - downloaded 95 times.)
« Last Edit: 22 January, 2011, 20:31:12 by Scout » Logged
Binder News
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 13 May, 2013, 22:50:58
Date Registered: 26 October, 2010, 22:05:05
Location: In a pit on an island somewhere in the Atlantic.
Posts: 779


Total Post Ratings: +43

View Profile
« Reply #1 on: 22 January, 2011, 16:47:26 »
0

Very useful. Definite bookmark!
Logged

Spoiler for userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler for Test Results:




Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 17:58:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Topic starter
Total Post Ratings: +174

View Profile
« Reply #2 on: 22 January, 2011, 20:40:08 »
0

Very useful. Definite bookmark!

Thanks much!

I edited with another program Grin
« Last Edit: 22 January, 2011, 20:41:03 by Scout » Logged
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Yesterday at 21:06:29
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3753


Total Post Ratings: +605

View Profile
« Reply #3 on: 22 January, 2011, 20:50:28 »
0

Want another chart I like to use?!? This is one I made after I learned assembly...
And I'm glad you're helping to spread the plague-- er, fun!

* Zeda's Opcode Reference Chart.xls (104 KB - downloaded 153 times.)
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 17:58:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Topic starter
Total Post Ratings: +174

View Profile
« Reply #4 on: 22 January, 2011, 21:23:42 »
0

Nice chart Xeda! I really like the way it looks! You should check mine and get the unofficial instructions and the IX and IY tables. Also the IX bits and IY bits tables and put them in yours. I did not fully make all of those, though. Runer made two of those, I just don't remember which.
Logged
holmes221b
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Female
Last Login: 09 January, 2012, 05:13:13
Date Registered: 15 June, 2010, 18:25:03
Location: Virginia, USA
Posts: 288


Total Post Ratings: +12

View Profile WWW
« Reply #5 on: 22 January, 2011, 21:24:54 »
0

What file type is xls? I don't recall ever seeing that one before...
* holmes221b wants to download it to start teaching herself how to program in HEX, but isn't sure if it's in a format she can read
Logged


Spoiler for "Projects":
Spoiler for "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX
FinaleTI
Believe in the pony that believes in you!
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 03 May, 2013, 16:35:01
Date Registered: 04 June, 2010, 00:34:27
Location: Alteria
Posts: 1818


Total Post Ratings: +118

View Profile WWW
« Reply #6 on: 22 January, 2011, 21:26:01 »
0

What file type is xls? I don't recall ever seeing that one before...
* holmes221b wants to download it to start teaching herself how to program in HEX, but isn't sure if it's in a format she can read
It's an Excel spreadsheet, but I think it'll open in OpenOffice as well.
Logged





So, yeah, I have a blog now. Nothing special, just your average ghost town.

Spoiler for Projects:
Spoiler for Pokemon TI:
Map engine is going to be redone from scratch, since I was lacking in organization last time. With a project as big as Pokemon, planning and organization is key, so that will probably be the brunt of the work done on this project for the time being.

Spoiler for Nostalgia:
Being worked on. Nothing really new to put here, but it's being worked on.

Spoiler for Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack.

Spoiler for Nostalgia Origins: Sky's Story:
Currently on hold. I am unsure of whether this will remain DCS7 Hybrid BASIC or if it will use Batlib, Grammer or perhaps Axe.
This may see more progress once a demo of Nostalgia is released.
Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 17:58:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Topic starter
Total Post Ratings: +174

View Profile
« Reply #7 on: 22 January, 2011, 21:26:22 »
0

What file type is xls? I don't recall ever seeing that one before...
* holmes221b wants to download it to start teaching herself how to program in HEX, but isn't sure if it's in a format she can read

It's Excel file, opened with Microsoft Excel, which can be either bought or used online for free in a limited way (Google Chrome+Hotmail Account).

www.davidgom.co.cc/z80table.html The tables are also there, online.
Logged
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Yesterday at 21:06:29
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3753


Total Post Ratings: +605

View Profile
« Reply #8 on: 22 January, 2011, 21:29:15 »
0

Yeah, I've checked yours... me likes Cheesy
Oh, um, yeah, I made it with Open Office...
« Last Edit: 22 January, 2011, 21:30:25 by Xeda112358 » Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


holmes221b
LV5 Advanced (Next: 300)
*****
Offline Offline

Gender: Female
Last Login: 09 January, 2012, 05:13:13
Date Registered: 15 June, 2010, 18:25:03
Location: Virginia, USA
Posts: 288


Total Post Ratings: +12

View Profile WWW
« Reply #9 on: 22 January, 2011, 22:15:21 »
0

Well, I do have Excell...It's been a long while since I've done anything in Excell, so no wonder I've forgotten the file extension...xD
Logged


Spoiler for "Projects":
Spoiler for "Because Everyone Else Is":
*Sigh*
can we keep this on topic? The topic is about what the big thing might be, NOT SEX
Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 17:58:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Topic starter
Total Post Ratings: +174

View Profile
« Reply #10 on: 22 January, 2011, 23:23:01 »
0

Well, I do have Excell...It's been a long while since I've done anything in Excell, so no wonder I've forgotten the file extension...xD

Oh I see, Excel is quite useful for this kind of tables, though.

So, anybody already knows (not you, Xeda) what the final program of my code does?
Logged
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Yesterday at 21:06:29
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3753


Total Post Ratings: +605

View Profile
« Reply #11 on: 23 January, 2011, 00:57:51 »
0

Pssh, that is SO unoptimised... Tongue
(but it is for an example, so I guess it's okay Cheesy)
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Munchor
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 17:58:01
Date Registered: 16 October, 2010, 15:39:13
Location: Position
Posts: 6209


Topic starter
Total Post Ratings: +174

View Profile
« Reply #12 on: 23 January, 2011, 00:59:45 »
0


1
2
3
4
5
6
7
8
9
EF4045
3E01
C60A
2600
6F
EF0745
EF7249
EF4045
C9

It could be optimized to:


1
2
3
4
5
6
EF4045
210B00
EF0745
EF7249
EF4045
C9

However, it would lose the point of the challange.
« Last Edit: 23 January, 2011, 01:08:26 by Scout » Logged
AngelFish
This is my custom title
Administrator
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Gender: Male
Last Login: Today at 02:07:40
Date Registered: 15 August, 2010, 09:18:54
Posts: 3188


Total Post Ratings: +218

View Profile
« Reply #13 on: 23 January, 2011, 01:04:40 »
0

Scout, no one is going to be able to remove their finger from the keypad quickly enough for that not to execute through Tongue

EDIT: Now write it without system calls  Evil
« Last Edit: 23 January, 2011, 01:05:20 by Qwerty.55 » Logged

∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Yesterday at 21:06:29
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3753


Total Post Ratings: +605

View Profile
« Reply #14 on: 23 January, 2011, 01:09:54 »
0

Been there. Done that. It is fun.
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.312 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.