Blackberry

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.

It Is a programming language that is stack-based, imperative and long-liner. And I wrote this article from my BB 8520.

Instructions

Instructions is base of Blackberry.

Stack

Stack related instructions.

Push/Pop

Push: Pushes data to stack. Pop: Pops data from stack to variable.

Purge/Discard

Discard: Pops (removes) data from stack. Purge: Same with Discard, but clears entire stack.

Dupe/Swap

Dupe: Duplicates top of the stack. Swap: Swaps places of top 2 elements of stack.

Standard IO

Input/Output related instructions.

StdIn/Out

COut: Writes to console. CIn: Reads from console to variable.

FileIn/Out

FOut: Writes to file. FSet: Sets specific variable to handle to that file. FClose: Closes specified handle FIn: Reads from file to variable. FAvail: Pushes 1 if not error occurred, 0 otherwise.

SocketIn/Out

SSet: Creates a socket with specified protocols. SConnect: Connects specified socket to specified address. SAvail: If not error occurred, this pushes 1. SIn: Reads socket. SOut: Writes to socket.

Samples

There's samples.

Hello world

COut "Hello, World!"