WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Creating Stack during execution, I want to create the stack (dynamically) after my program has checked the RAM memory.

beamer
Quote Post


New Member
*

Group: Members
Posts: 1
Member No.: 29638
Joined: 4-December 09


Hello,

My name is Marcel and I am new on this forum, I have a question about the following:

I am working on a 16 bit application for a AM186ES processor (x86 compatible), this processor has no internal ROM or RAM. My application will be stored on a PC-Card from which the processor directly can execute the code.
One purpose of the program is to test the RAM memory which is externally mounted on the PCB next to the AM186ES, now is my question, how can I create stack after I have tested my RAM memory, the standard keyword STACK declares the stack before the program is executed, but I want to create the stack (dynamically) after my program has checked the RAM memory.

Another question, how does my AM186ES now where to create the stack, it can address max 1 MB but it is connected to a flash as well, how does the AM186ES know at which address the RAM memory is located? Do I need to set the ss register to the (base) addres of the RAM?

And the last question, I have declared some global variables in my data segment, does the AM186ES store this variables on the stack or on my PC-Card? If on my stack, how can I "delay" this till my RAM is checked, as mentioned above.

I use a TASM assembler for the project.

Thanks for your help,

Marcel
PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2301
Member No.: 160
Joined: 22-June 04


1.stack is creating with initialisation of ss:sp only. if you wish to test memory first, you may use ram-less call trick in your code:

CODE
call near somefunc
...

replace with:
CODE
mov sp,@F
jmp near somefunc
@@: dw $+2
...


this trick is used in bios on the first stage when memory is not used yet. look into any bios to check how does it work. you may use also far procedure call, just put value to "restore" cs also into that local "stack"

2.your cpu has no brain to differ ram from rom. it is the task of your software. just place ram into the start of adress range, and rom into the end of it. cpu will need ffff:0000 adress in rom after reset and ram starting from 0000:0000 for interrupts vectors (if they are in use in your device, of course)

==========================================

look there: you may found a code there to blink through lpt on 386 board without installed memory at all: http://www.winasm.net/forum/index.php?showtopic=770
it is generally useless, but works, so, can be used as test wink.gif

This post has been edited by shoorick on Dec 7 2009, 07:11 AM
PMEmail PosterUsers Website
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google