Click here to Skip to main content
15,916,189 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Stalkers ? Pin
User 110609792-Jun-18 5:43
User 110609792-Jun-18 5:43 
GeneralRe: Stalkers ? Pin
Ian Bell, #22-Jun-18 7:03
professionalIan Bell, #22-Jun-18 7:03 
GeneralRe: Stalkers ? Pin
User 110609792-Jun-18 8:08
User 110609792-Jun-18 8:08 
GeneralRe: Stalkers ? Pin
kmoorevs2-Jun-18 9:36
kmoorevs2-Jun-18 9:36 
GeneralRe: Stalkers ? Pin
User 110609793-Jun-18 2:07
User 110609793-Jun-18 2:07 
GeneralRe: Stalkers ? Pin
Daniel Pfeffer2-Jun-18 10:32
professionalDaniel Pfeffer2-Jun-18 10:32 
GeneralRe: Stalkers ? Pin
Amarnath S2-Jun-18 6:09
professionalAmarnath S2-Jun-18 6:09 
GeneralI now have a BIOS and lots of SEX Pin
CodeWraith2-Jun-18 0:24
CodeWraith2-Jun-18 0:24 
ProtoZwölf is the minimal configuration of the 8 bit computer I am building. I'm going to use it to develop and debug all further hardware. This minimal computer needs a BIOS to communicate with a PC and test the new hardware expansions. Here is a screenshot of the first running version, in emulation:

ProtoZwölf starting up[^]

Ok, the list of checks and initialization is still a little short, but it will grow longer. For now we only can check the ROM, the RAM and serial I/O. It's ok that the checksum is wrong. I don't update it every five minutes while I still change the code.

BIOS setup does not do very much yet. I don't have any convenient place to store the configuration. If I use EEPROMs or Flash ROMs, I could save them in the ROM, but that would kill the IC if used too much.

BIOS CMD is the part I'm working on right now. I am going to need a protocol to upload test programs and (if I use EEPROMs) BIOS updates. A complete memory check may also be nice.

Really booting will have to wait. I'm going to need a boot device first and then an OS to boot.


The first real obstacle was the stack protocol for calling subroutines. To avoid 'knots' on the stack, the traditional protocol inlined the subroutine's address and the parameters in the code.

Yuk! That's very close to self modifying code which has gone out of fashion for many good reasons. The solution: I need separate call and parameter stacks. Ugly on most processors, but not here. I have 16 general purpose registers at my disposal and can make any one of them the stack pointer at any time. All I have to do is to initialize two registers to suitable addresses and then switch between them using the SET X (SEX) instruction as needed. Program counters work similar, only that it's the P register and the SEP instruction that designates the program counter:

Here is a 'sexy' subroutine. It can call more subroutines until I have a stack overflow and saves and restores all registers that are changed (obviously a big thing on a processor with so many free registers).

; =========================================================================================
; RS232 Out (software protocol)
; 
; Parameters:
; 01	Character to be sent (byte)
; 
; Return:
; ---
; =========================================================================================

RS232OutSoftware:	SEX  R2							; save registers RE and RF on the call stack
					GHI  RF
					STXD
					GLO  RF
					STXD
					GHI  RE
					STXD
					GLO  RE
					STXD

					SEX  R6							; load parameter 01 into RE.1
					IRX
					LDX
					PHI  RE

					REQ								; Q = 0
					LDI  BIT_COUNT					; load bit counter into RE.0
					PLO  RE

					SEQ								; Q = 1 (start bit)
					LDI  BIT_DELAY					; delay for one bit phase
					PLO  RF
SER_Delay1:			DEC  RF
					GLO  RF
					BNZ  SER_Delay1

SER_TransLoop:		GHI  RE							; shift out highest bit from the character
					SHRC
					PHI  RE
					LSDF							
					SEQ								; Q = 1 if bit = 0
					SKP
					REQ								; Q = 0 if bit = 1
					
					LDI  BIT_DELAY					; delay for one bit phase
					PLO  RF
SER_Delay2:			DEC  RF
					GLO  RF
					BNZ  SER_Delay2

					DEC  RE							; decrement bitcount
					GLO  RE
					LBNZ SER_TransLoop				; shift out another bit if not done yet
					
					REQ								; Q = 0 (parity bit, always 0?)
					LDI  BIT_DELAY					; delay for one bit phase
					PLO  RF
SER_Delay3:			DEC  RF
					GLO  RF
					BNZ  SER_Delay3

					LDI  BIT_DELAY					; delay for one bit phase (stop bit)
					PLO  RF
SER_Delay4:			DEC  RF
					GLO  RF
					BNZ  SER_Delay4

					SEX  R2							; restore registers RE and RF from call stack
					IRX
					LDXA
					PLO  RE
					LDXA
					PHI  RE
					LDXA
					PLO  RF
					LDX
					PHI	 RF
					SEP  R5
				
;------------------------------------------------------------------------------------------

I have lived with several Zen masters - all of them were cats.

His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.


modified 2-Jun-18 6:51am.

GeneralSo VISA is back to normal Pin
OriginalGriff2-Jun-18 0:07
mveOriginalGriff2-Jun-18 0:07 
GeneralRe: So VISA is back to normal Pin
Nish Nishant2-Jun-18 7:57
sitebuilderNish Nishant2-Jun-18 7:57 
GeneralRe: So VISA is back to normal Pin
GenJerDan3-Jun-18 19:53
GenJerDan3-Jun-18 19:53 
GeneralRe: So VISA is back to normal Pin
OriginalGriff3-Jun-18 20:02
mveOriginalGriff3-Jun-18 20:02 
GeneralJust found an awesome YouTube channel Pin
Brisingr Aerowing1-Jun-18 21:55
professionalBrisingr Aerowing1-Jun-18 21:55 
GeneralRe: Just found an awesome YouTube channel Pin
Marc Clifton2-Jun-18 2:58
mvaMarc Clifton2-Jun-18 2:58 
GeneralInteresting... Pin
Brisingr Aerowing1-Jun-18 17:28
professionalBrisingr Aerowing1-Jun-18 17:28 
GeneralRe: Interesting... Pin
Marc Clifton2-Jun-18 3:00
mvaMarc Clifton2-Jun-18 3:00 
GeneralRe: Interesting... Pin
swampwiz2-Jun-18 8:30
swampwiz2-Jun-18 8:30 
GeneralSometimes you have to be explicit its a joke or else... Pin
virang_211-Jun-18 16:00
virang_211-Jun-18 16:00 
GeneralRe: Sometimes you have to be explicit its a joke or else... Pin
Jon McKee1-Jun-18 19:16
professionalJon McKee1-Jun-18 19:16 
GeneralRe: Sometimes you have to be explicit its a joke or else... Pin
dandy722-Jun-18 3:54
dandy722-Jun-18 3:54 
GeneralRe: Sometimes you have to be explicit its a joke or else... Pin
kmoorevs2-Jun-18 5:10
kmoorevs2-Jun-18 5:10 
GeneralCustom Exceptions Pin
RandyBuchholz1-Jun-18 8:51
RandyBuchholz1-Jun-18 8:51 
GeneralRe: Custom Exceptions Pin
PIEBALDconsult1-Jun-18 9:28
mvePIEBALDconsult1-Jun-18 9:28 
GeneralRe: Custom Exceptions Pin
Eric Lynch1-Jun-18 9:38
Eric Lynch1-Jun-18 9:38 
GeneralRe: Custom Exceptions Pin
OriginalGriff1-Jun-18 10:48
mveOriginalGriff1-Jun-18 10:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.