flat assembler
Message board for the users of flat assembler.

Index > Main > HOW EPROM progrmming?

Author
Thread Post new topic Reply to topic
delta67



Joined: 18 Jul 2012
Posts: 19
delta67
Hi all,

I want to write a simple assembly program for testing a 8088 based SBC. Please, How can I get the binary file to burn in flash using FASM ?

I've a 8K byte flash EPROM (ATMEL 28C64B) . I want to know how can I get a JUMP to the begining of flash (0000H) at reset of processor??

perhaps I should do some thing like this:

ORG FFF0H

JMP init ; "init" is the start of prgram at 0000H

Many thanks
Post 18 Jul 2012, 11:38
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2140
Location: Estonia
Madis731
org doesn't change the pointer. You need an absolute jump if you don't know where you are. If you know exactly where you are at the start of the execution then just put org there and do a relative jump.
Post 18 Jul 2012, 12:53
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1606
Location: Ukraine
shoorick
Post 18 Jul 2012, 13:05
View user's profile Send private message Visit poster's website Reply with quote
delta67



Joined: 18 Jul 2012
Posts: 19
delta67
Madis731 wrote:
org doesn't change the pointer. You need an absolute jump if you don't know where you are. If you know exactly where you are at the start of the execution then just put org there and do a relative jump.

Thanks for ur reply Madis731.
I think an absolute jump to 0000h is the best solution !!
Post 18 Jul 2012, 17:48
View user's profile Send private message Reply with quote
delta67



Joined: 18 Jul 2012
Posts: 19
delta67

Thanks shoorick for the link.
Post 18 Jul 2012, 17:49
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Absolute jump to 0000h may not do the job. The question is, how the EPROM (or FLASH) is mapped in the address space of the CPU?

Generally, asking such question, it is good to post the memory map of the computer.
Post 18 Jul 2012, 17:58
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
delta67



Joined: 18 Jul 2012
Posts: 19
delta67
and i found this code:

;=========================================
rom_size = 800h
rom_start = 100000h - rom_size
rom_empty = 0FFh
;=========================================
use16
;-----------------------------------------
start:
mov dx,378h
mov al,0
next:
out dx,al
mov cx,07FFFh
delay:
loop delay
not al
jmp next
;-----------------------------------------
times rom_size - 16 - $ db rom_empty
;-----------------------------------------
boot:
jmp (rom_start shr 4):start
;-----------------------------------------
times rom_size - $ db rom_empty
;=========================================

here: http://board.flatassembler.net/topic.php?t=8189
Post 18 Jul 2012, 18:05
View user's profile Send private message Reply with quote
delta67



Joined: 18 Jul 2012
Posts: 19
delta67
JohnFound wrote:
Absolute jump to 0000h may not do the job. The question is, how the EPROM (or FLASH) is mapped in the address space of the CPU?

Generally, asking such question, it is good to post the memory map of the computer.

The SBC uses only 16 bits for adressing thus the EPROM must be the last 8K bytes E000-FFFF.
Post 18 Jul 2012, 18:12
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
delta67 wrote:
The SBC uses only 16 bits for adressing thus the EPROM must be the last 8K bytes E000-FFFF.


That means that the EPROM is mapped several times (16) in the address space. Anyway, it is better to use the last image. It is from $FE000 to $FFFFF.
The jump to the beginning of the EPROM should be "jmp $FE00:0000" and the code in the EPROM should be "org $0"

P.S. The source you quoted is OK for your job, only you should set the rom_size to $2000.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 18 Jul 2012, 18:38
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
delta67



Joined: 18 Jul 2012
Posts: 19
delta67
JohnFound wrote:
delta67 wrote:
The SBC uses only 16 bits for adressing thus the EPROM must be the last 8K bytes E000-FFFF.


That means that the EPROM is mapped several times (16) in the address space. Anyway, it is better to use the last image. It is from $FE000 to $FFFFF.
The jump to the beginning of the EPROM should be "jmp $FE00:0000" and the code in the EPROM should be "org $0"

P.S. The source you quoted is OK for your job, only you should set the rom_size to $2000.


Thanks JhonFound
Post 18 Jul 2012, 19:33
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.