flat assembler
Message board for the users of flat assembler.

Index > Main > is it possible to assembly a code with no assembler?

Author
Thread Post new topic Reply to topic
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 15 May 2010, 19:29
Do you get it? For example, the first software done when there is no another one, how it was compiled (assembled)?

_________________
Sorry if bad english.
Post 15 May 2010, 19:29
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 15 May 2010, 19:44
Eniac was the fist PC if I remember it right. http://en.wikipedia.org/wiki/ENIAC

It used Binary coded decimal "Excess 3" Put on punch cards originaly I think..

EDIT: If you REALLY wanted to you could still code with out an assembler/compiler but you need to know the opcodes in binnary/hex... I think MikeOS has a program that lets you type in opcodes and press enter to launch them... you could also make your own VERY easaly or just use a hex editor... you could even use the Fasm db sequence
Code:
db 0x66 0xB9 0xFF ; mov ecx, 0xFF    

you can look here for more
Post 15 May 2010, 19:44
View user's profile Send private message Visit poster's website Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 15 May 2010, 20:32
http://en.wikipedia.org/wiki/Ada_Lovelace#First_computer_program The first "programmer" not only programmed w/o an assembler, but w/o a computer also(she made a theoretical algo for a theoretical "computer").

But yeah, if you happen to be a freak of nature that can remember opcodes and how to encode(specify types/sizes of operands and operands themselves) them, you could write a program with a hex editor. If you really want to try it, it just happens that we have one of those freaks of nature on this forum, Mazegen, his reference is great. It can be viewed in alphabetic order by mnemonic or numerically by opcode.

Coddy41 wrote:

you could even use the Fasm db sequence

I've always padded my boot sectors with nops(0x90) using that method(idk why I don't just use "nop"). Other than "nop," I don't know any opcodes. No need to, I got Fasm Razz.
Post 15 May 2010, 20:32
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 15 May 2010, 21:02
Why do you people go back so far in time? As late as the 70-80ies, engineers continued to use punched cards and tapes (e.g. DEC's PDPs). So even at that time they didn't care about the luxury of having assemblers and compilers. We really have lost our ways! Cool
Post 15 May 2010, 21:02
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 15 May 2010, 21:53
very good, thank you guys.
Post 15 May 2010, 21:53
View user's profile Send private message Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 15 May 2010, 23:29
Tyler wrote:
Other than "nop," I don't know any opcodes. No need to, I got Fasm Razz.

I have learned quite a bit playing with opcodes that past ~2 hours... took me allot of work but I think I almost got all the bugs worked (clearing screen and writing "hi Smile" using direct memory acsess and raw opcodes w/ 32bit) Atleast I understand some things that made me scratch my head before.
ManOfSteel wrote:
As late as the 70-80ies, engineers continued to use punched cards and tapes (e.g. DEC's PDPs). So even at that time they didn't care about the luxury of having assemblers and compilers. We really have lost our ways! Cool

Right now that sounds like my sort of time Very Happy

_________________
Want hosting for free for your asm project? You can PM me. (*.fasm4u.net)
Post 15 May 2010, 23:29
View user's profile Send private message Visit poster's website Reply with quote
roboman



Joined: 03 Dec 2006
Posts: 122
Location: USA
roboman 16 May 2010, 02:22
Punch cards and tape, how about putting the program directly into memory with switches on the front of the computer. http://www.altairkit.com/ I almost miss my old Altair.

I thought Eniac had a 'rom' that was 'writen' to by changing jumper wires directly on the 'rom' board, might be thinking of some other early big computer. Ah yes it was [It was programmed by a combination of plugboard wiring and three "portable function tables". Each function table has 1200 ten-way switches, used for entering tables of numbers.]
Post 16 May 2010, 02:22
View user's profile Send private message Visit poster's website Reply with quote
Coddy41



Joined: 18 Jan 2009
Posts: 384
Location: Ohio, USA
Coddy41 16 May 2010, 14:30
Ah, I probibly got it confused with something else then(do it all the time I wouldn't be suprised)... I find it funny how the original programmers were wemon but now it seems
that mostly only men code these days...
Quote:
how about putting the program directly into memory with switches on the front of the computer. http://www.altairkit.com/ I almost miss my old Altair.

it would be nice for testing code rather than wasting tap and cards just to see if it worked...

_________________
Want hosting for free for your asm project? You can PM me. (*.fasm4u.net)
Post 16 May 2010, 14:30
View user's profile Send private message Visit poster's website Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 16 May 2010, 21:29
is Fasm done in C or something?
Post 16 May 2010, 21:29
View user's profile Send private message Reply with quote
Tyler



Joined: 19 Nov 2009
Posts: 1216
Location: NC, USA
Tyler 16 May 2010, 21:58
Are you serious? Confused Download a Fasm package and look in any file in the SOURCE folder.
Post 16 May 2010, 21:58
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel 16 May 2010, 22:03
Teehee wrote:
is Fasm done in C or something?

O_o Is this a serious question?

If I'm not mistaken, Tomasz implemented it first in tasm, then rewrote it in fasm for self-hosting.
Post 16 May 2010, 22:03
View user's profile Send private message Reply with quote
Teehee



Joined: 05 Aug 2009
Posts: 570
Location: Brazil
Teehee 17 May 2010, 15:58
ManOfSteel wrote:
Tomasz implemented it first in tasm, then rewrote it in fasm for self-hosting.

I would reach in that point. Sorry for scare you guys Smile

_________________
Sorry if bad english.
Post 17 May 2010, 15:58
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 18 May 2010, 12:56
my first assembly programs were written exactly without assembler Wink

Image

as well as disassembly Wink

Image

_________________
UNICODE forever!
Post 18 May 2010, 12:56
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 19 May 2010, 11:48
shoorick, that's a piece of art!!! Very Happy

I remember that at my early ages, I couldn't find any machine code book around for my CPC464...you can imagine my frustation Smile
Post 19 May 2010, 11:48
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 19 May 2010, 12:00
it was because my first hand-made pc has no deal with cassette recorder first time Smile who knows if i ever were known on such art, if it would work well from start Wink
Post 19 May 2010, 12:00
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 19 May 2010, 13:53
maybe it can be pretty easy to write an hexadecimal editor, in less than 512 bytes, that give the hability to write binary code, and execute it.

a good contest i believe will be to do that. Very Happy
Post 19 May 2010, 13:53
View user's profile Send private message Visit poster's website Reply with quote
edemko



Joined: 18 Jul 2009
Posts: 549
edemko 19 May 2010, 13:59
morphing viruses based on your ideas edfed
Post 19 May 2010, 13:59
View user's profile Send private message Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 19 May 2010, 14:38
edfed
why not? even up to 64kb Wink then it will be possible to write it into eprom as bios extension Wink i do not see any physical reason in 512 bytes. sector? do you have a diskette with single sector? Wink generally, i have some ansient 512 bytes OTP roms, but have no programmer for them yet, and they are not in DIP package, only soldering available... least reprogrammable ROM i have is 2kb 2716. so, as usual i can promise to write winning project into real eprom and test on real pc Wink

writing a 27512 (it was ROMOS)
Post 19 May 2010, 14:38
View user's profile Send private message Visit poster's website Reply with quote
edfed



Joined: 20 Feb 2006
Posts: 4353
Location: Now
edfed 19 May 2010, 15:14
here the squeleton for this idea.
Image

just the hexadecimal view.


hexexe.asm (i like this name, hexexe, because it drives crazy ot read Laughing)
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        org 100h
        mov ax,0b800h
        mov es,ax
        mov ax,cs
        mov gs,ax
@@:
        xor di,di
        call linenumber

        mov di,(4+1)*2
        call hexview

        mov di,(32+1+4+1)*2
        call asciiview

        mov di,70*2
        mov si,hexexe
        call textview

        call edit
        call run
;        add [index],16
;        cmp [index],0
;        hlt
;        jne @b
;        mov ax,3
;        int 10h
        ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
black=0
blue=1
green=2
cyan=3
red=4
magenta=5
brown=6
gray1=7
gray2=8
teal=9
lime=10
aqua=11
skin=12
pink=13
yellow=14
white=15
numbercolor= yellow+blue*16
hexacolor  = black+gray1*16
asciicolor = black+gray1*16
textcolor  = black*16+white
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hexexe  db 'hexexe.com',0
cursor  db 0,0
index   dw 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
textview:
        mov ah,textcolor
@@:
        lodsb
        cmp al,0
        je @f
        stosw
        jmp @b
@@:
        ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hexview:
        mov ah,hexacolor
        mov bx,[index]
        mov dh,25
.line:
        mov cx,16
.load:
        mov dl,[gs:bx]
        call hexdigit
        shr dl,4
        call hexdigit
        inc bx
        xor ah,1
        loop .load
        add di,160-16*4
        dec dh
        jne .line
.end:
        ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
asciiview:
        mov ah,asciicolor
        mov bx,[index]
        mov dh,25
.line:
        mov cx,16
.load:
        mov al,[gs:bx]
        stosw
        inc bx
        xor ah,1
        loop .load
        add di,160-16*2
        dec dh
        jne .line
.end:
        ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
edit:
        ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
run:
        ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
linenumber:
        mov dx,[index]
        mov bl,25
        mov ah,numbercolor
@@:
        mov cx,4
.cycle:
        rol dx,4
        call hexdigit
        loop .cycle
        add di,160-8
        add dx,16
        dec bl
        jne @b
        ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hexdigit:
        mov al,dl
        and al,0Fh
        cmp al,10
        sbb al,069h
        das
        stosw
        ret    

compile in 179 bytes, 331 bytes free for a boot sector.

the size limited to 512 bytes because of bootsector, and the need to write by hand all digits in ordre to execute the code one more time, like fasm does compile itself, hexexe editing itself Smile


need to code edit and run functions now.
Smile
Post 19 May 2010, 15:14
View user's profile Send private message Visit poster's website Reply with quote
alorent



Joined: 05 Dec 2005
Posts: 221
alorent 20 May 2010, 06:13
edfed, I like the idea! Very Happy
Post 20 May 2010, 06:13
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.