Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
czhower committed Jan 6, 2018
1 parent a8c23c7 commit 49d2c7c
Showing 1 changed file with 3 additions and 99 deletions.
102 changes: 3 additions & 99 deletions README.md
Expand Up @@ -8,106 +8,10 @@ X# is integrated into Visual Studio and we are working on support for Visual Stu

X# creates NASM style assembly ready to assemble with [NASM](http://www.nasm.us/).

# More Info
Please refer to our website (http://www.x-sharp.net)

# Status
Currently X# is used by the [C# Open Source Managed Operating System (COSMOS)](http://www.goCosmos.org) and parts of it are bound to Cosmos. We are in the process of and nearly finished separating out X# to allow it to operate as a stand alone project to allow users to make their own custom creations using X#.

We have physicallly separated out X# and checked it in here. However there are still a few hard coded links to Cosmos and there is no independent documentation yet, nor are there standalone samples. We are working all of these issues.

# Sample

```
namespace DebugStub
var .DebugWaitMsg = 'Waiting for debugger connection...'
! %ifndef Exclude_Memory_Based_Console
const VidBase = $B8000
function Cls {
ESI = #VidBase
// End of Video Area
// VidBase + 25 * 80 * 2 = B8FA0
while ESI < $B8FA0 {
// Text
ESI[0] = $00
ESI++
// Colour
ESI[0] = $0A
ESI++
}
}
function DisplayWaitMsg {
ESI = @..DebugWaitMsg
EDI = #VidBase
// 10 lines down, 20 cols in (10 * 80 + 20) * 2)
EDI + 1640
// Read and copy string till 0 terminator
while byte ESI[0] != 0 {
AL = ESI[0]
EDI[0] = AL
ESI++
EDI + 2
}
}
! %endif
```

# Resulting NASM Output

```
; Generated at 14-6-2016 12:37:38
DebugWaitMsg db 87, 97, 105, 116, 105, 110, 103, 32, 102, 111, 114, 32, 100, 101, 98, 117, 103, 103, 101, 114, 32, 99, 111, 110, 110, 101, 99, 116, 105, 111, 110, 46, 46, 46, 0
%ifndef Exclude_Memory_Based_Console
DebugStub_Const_VidBase equ 753664
DebugStub_Cls:
mov dword ESI, DebugStub_Const_VidBase
DebugStub_Cls_Block1_Begin:
cmp dword ESI, 0xB8FA0
JNB near DebugStub_Cls_Block1_End
mov dword [ESI], 0x0
inc dword ESI
mov dword [ESI], 0xA
inc dword ESI
Jmp DebugStub_Cls_Block1_Begin
DebugStub_Cls_Block1_End:
DebugStub_Cls_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_Cls_Exit
Ret
DebugStub_DisplayWaitMsg:
mov dword ESI, DebugWaitMsg
mov dword EDI, DebugStub_Const_VidBase
add dword EDI, 0x668
DebugStub_DisplayWaitMsg_Block1_Begin:
cmp byte [ESI], 0x0
JE near DebugStub_DisplayWaitMsg_Block1_End
mov byte AL, [ESI]
mov byte [EDI], AL
inc dword ESI
add dword EDI, 0x2
Jmp DebugStub_DisplayWaitMsg_Block1_Begin
DebugStub_DisplayWaitMsg_Block1_End:
DebugStub_DisplayWaitMsg_Exit:
mov dword [static_field__Cosmos_Core_INTs_mLastKnownAddress], DebugStub_DisplayWaitMsg_Exit
Ret
%endif
```

0 comments on commit 49d2c7c

Please sign in to comment.