![]() |
Hoo boy, I'm in so much pain, and I doubt I'll be able to explain this bit of code all that well, but here goes.
Code:
; #1 #2 #3 As for which one I'm sticking with, I'm sticking with #2 as it's quicker than the rest, and it's a good one for showing how writing multiple lines which do the same thing is far superior to using loops. (I won't explain how, as I'm just too exhausted from this pain, but trust me, :thumbsup:) #1 took me most of today to write, and #2 only took me a few minutes, #3, about a minute or two. What this code does, is it translates an integer into a binary representation along with a string delimiter, so the following would take place for a number 34979. Code:
itobf(str, 34979, 4); str = "1000:1000:1010:0011" Code:
DEC DL ; Ensure that if 8 is passed, it becomes 7, which equals 111b |
I like it lol
And I hope you feel better soon! :hug: |
Oh-kay! I revamped my itob routine, it's a bit longer than the old one, but it's still pretty quick.
Code:
Basically, Code:
itob(str, 37, 3); str = "101" |
Still having massive troubles with sleeping, so I decided to revisit my big integer library that I've been trying to re-write in assembly...
So, in order to utilize the stack space, which would allow me to keep a lot of the old code I've already written, as well as make a lot of the work so so soooo much simpler, I've decided to use the following lines of code... Code:
PUSH RBP Save RBP Code:
a = new_bigint(); // This would create a new bigint, and append it to Lastly, by utilizing a linked list for storing all the big integers, then the "deconstructor" (free) routine could be written without having to rewrite it every single time. Code:
|
Mental note to self: The following code is perfectly fine...(I asked someone in another forum and they concurred).
Code:
MOV reg , [reg] |
Holy halibuts I'm having such trouble concentrating...
Anyhoo, I got the first macros at least finished. Code:
; Assembly macros Code:
backupTo RBP, reg1, reg2, reg3, ... |
Alrighty! Was able to use some of my mind so I wrote a few things down, and made some hella mods to my Makefile and binary/hex routines.
Makefile Note: Need to research .PHONY in a Makefile. Code:
ASMSRC=$(wildcard *.asm) I think I need to redo my Makefile to reflect the changes to each routine, as a common use Makefile section might prove to be too much...O_o. Code:
; Defines Code:
; Defines |
Alrighty! After a lot of "dumb" time, I finally had enough brain umph to research the XMM registers. They're useful for double/single precision numbers, but integers, they're crap. So...I really have no use for them, at least now. So that answers that question, and I can stop fretting about the "what ifs".
|
And or xor not shl shr ror rol
The instructions I'm going to write about are the following, AND, OR, XOR, NOT, SHL, SHR, ROR, ROL.
Prerequisite: As most know, computers only see 1's and 0's. A good way to think of this, is "on" and "off", or "set" and "not set". So any number, character, be it a byte: 0000:0000 (Hexadecimal 0x:00), a word: 0000:0000:0000:0000 (Hexadecimal 0x:00:00), an dword 0x:00:00:00:00, and a quadword 0x:00:00:00:00:00:00:00:00, is represented in this fashion. 1 = 0000:0001 2 = 0000:0010 4 = 0000:0100 So on and so forth. SHL, SHR The best way to explain this, is division by 2 and multiple of 2. Code:
MOV AL , 1 ; AL = 1, or 0000:0001 Code:
MOV AL , 1 ; AL = 0000:0001 = 1 In the ROR instruction the 1 was ROtated Right or ROlled Right (So the 1 was ROlled to the other side of the 8 bit register). The rest of the instructions (I hope I can continue with a decent explanation of as my mind is starting to falter), should be apparent with the following code. Code:
MOV AL , 0b101 ; AL = 5 = 0000:0101 (My brain has faltered, and can't concentrate any more. If anyone has any questions, it'd sure help with focusing my thoughts, but there's too few of us oddballs out there who'd like to know more, :rolleyes:) |
All times are GMT -5. The time now is 04:49 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Shoutbox provided by
vBShout v6.2.1 (Lite) -
vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
vBulletin Security provided by
vBSecurity v2.2.2 (Pro) -
vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.