This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------------- | |
// first.s: Output "Welcome to Assembly World." | |
// | |
// compile using: $ as first.s -o first.o | |
// link using: $ ld first.o -o first | |
// execute using: $ ./first | |
// | |
//---------------------------------------------------------------- | |
.section .data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------------- | |
// Holan.s: print the 'Holan' in ascii code | |
// | |
// compile using: $ as Holan.s -o Holan.o | |
// link using: $ ld Holan.o -o Holan | |
// execute using: $ ./Holan | |
// | |
//---------------------------------------------------------------- | |
.text # this section is program | |
.global _start # entry point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//---------------------------------------------------------------- | |
// sum.s: | |
// | |
// compile using: $ as sum.s -o sum.o | |
// link using: $ ld sum.o -o sum | |
// execute using: $ ./sum | |
// | |
//---------------------------------------------------------------- | |
.text # this section is program | |
.global _start # entry point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Expressive { | |
public static void main(String args[]) { | |
Expressive puzzler = new Expressive(); | |
puzzler.Oddity(); | |
puzzler.Chage(); | |
puzzler.LongDivision(); | |
puzzler.Elementary(); | |
puzzler.JoyOfHex(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.globl start | |
.code16 | |
start: | |
movb $0xE, %ah # write character in text mode for int 10h | |
movb $'H', %al # write 'H', 'o', 'l', 'a', 'n', ' ', 'w', 'o', 'r', 'l', 'd' | |
int $0x10 | |
movb $'o', %al | |
int $0x10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AS = as | |
LD = ld | |
OBJCOPY = objcopy | |
.s.o: | |
$(AS) -a $< -o $*.o > $*.map | |
all: disk.img | |
disk.img: holanBoot.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qemu-system-i386 -hda disk.img |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
void prtMsg(const int &s, const int &n) | |
{ | |
if( s == n ) | |
cout << "完全數"; | |
else if( s > n ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <sstream> | |
#include <stack> | |
using namespace std; | |
int main(){ | |
string input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sstream> | |
using namespace std; | |
int main() | |
{ | |
string str; | |
while(getline(cin, str)) |
OlderNewer